
curl http://yunchuang.58dns.org/exapi/servers?apikey=cW69js29dvwp2PgqBqslo3ZFfTKmO8SJ2gDHmEyUeESXk162557425891757



curl -L -X POST 'http://yunchuang.58dns.org/exapi/documents/-1?apikey=cW69js29dvwp2PgqBqslo3ZFfTKmO8SJ2gDHmEyUeESXk162557425891757' \
    -H 'Content-Type: application/json' \
    -d '{
        "action": "run",
        "request_id": "20230613182013001abcdefgh",
        "server_id": 24,
        "sql": "select username,realname FROM hdp_lbg_supin_zplisting.dim_zp_n_n_emp_org WHERE dt=20230612"
    }'

# 根据 request_id 获取任务 id
curl -X GET 'http://yunchuang.58dns.org/exapi/requests?request_id=20230613182013001abcdefgh&apikey=cW69js29dvwp2PgqBqslo3ZFfTKmO8SJ2gDHmEyUeESXk162557425891757'

# 获取任务运行进度
curl -X GET 'http://yunchuang.58dns.org/exapi/progresses?apikey=cW69js29dvwp2PgqBqslo3ZFfTKmO8SJ2gDHmEyUeESXk162557425891757&id_list=107683897'

# 获取结果输出状态
curl -X GET 'http://yunchuang.58dns.org/exapi/output_statuses?id_list=107683897&apikey=cW69js29dvwp2PgqBqslo3ZFfTKmO8SJ2gDHmEyUeESXk162557425891757'

# 获取任务结果下载地址
curl -X GET 'http://yunchuang.58dns.org/exapi/tasks/107683897/results?apikey=cW69js29dvwp2PgqBqslo3ZFfTKmO8SJ2gDHmEyUeESXk162557425891757'

# 下载任务结果
curl -X GET 'http://yunchuang.58dns.org/download/results/107683897_CC62B0CACF2D4AA19F5ACE1876BF91B9.out.txt'


$ sh yunchange.sh
{
  "code": 0,
  "data": {
    "created_dt": "2023-06-13 19:57:44",
    "duration": "-",
    "engine": "hive",
    "file_id": -1,
    "filename": "",
    "id": 107684364,
    "is_cron_job": false,
    "mail_send_fail_msg": "",
    "mail_send_status": 0,
    "output_type": "default",
    "progress": 0,
    "re_run_parent_id": -1,
    "server_type": "hive",
    "sql": "select username,realname FROM hdp_lbg_supin_zplisting.dim_zp_n_n_emp_org WHERE dt=20230612",
    "status": "等待中"
  },
  "error_msg": {},
  "status": "success"
}%

$ curl -X GET 'http://yunchuang.58dns.org/exapi/requests?request_id=20230613182013001abcdefgh&apikey=cW69js29dvwp2PgqBqslo3ZFfTKmO8SJ2gDHmEyUeESXk162557425891757'
{
  "code": 0,
  "data": [
    107684364
  ],
  "status": "success"
}%